import Iori from './Iori';

let heroMap = {
    'Iori': Iori
}

// 角色工厂
class HeroFactory {
    static make({ key, ...props }) {
        props.direction = 'left'
        if (props.keybord === 'p2') {
            props.direction = 'right'
        }
        if (heroMap[key]) {
            return new heroMap[key](props)
        }
        return new heroMap['Iori'](props)
    }
}

export default HeroFactory;
